package com.gmail.volodymyrdotsenko.roo.webeasy;

import org.springframework.roo.model.JavaPackage;
import org.springframework.roo.model.JavaType;
import org.springframework.roo.project.GAV;
import org.springframework.roo.project.packaging.PackagingProvider;

/**
 * Interface of operations this add-on offers. Typically used by a command type
 * or an external add-on.
 * 
 * @since 1.1
 */
public interface WebeasyOperations {

	/**
	 * Indicate commands should be available
	 * 
	 * @return true if it should be available, otherwise false
	 */
	boolean isCommandAvailable();

	/**
	 * Annotate the provided Java type with the trigger of this add-on
	 */
	void annotateType(JavaType type);

	/**
	 * Annotate all Java types with the trigger of this add-on
	 */
	void annotateAll();

	/**
	 * Creates a Maven-based project
	 * 
	 * @param topLevelPackage
	 *            the top-level Java package (required)
	 * @param projectName
	 *            the name of the project (can be blank to generate it from the
	 *            top-level package)
	 * @param majorJavaVersion
	 *            the major Java version to which this project is targetted (can
	 *            be <code>null</code> to autodetect)
	 * @param parentPom
	 *            the Maven coordinates of the parent POM (can be
	 *            <code>null</code> for none)
	 * @param packagingType
	 *            the packaging of the project (can be <code>null</code> to use
	 *            the default)
	 */
	void createProject(JavaPackage topLevelPackage, String projectName,
			Integer majorJavaVersion, GAV parentPom,
			PackagingProvider packagingType);
}